use Mojo::mysql;
use strict;
#use utf8;

my $mysql = Mojo::mysql->strict_mode('mysql://dahama:xxxxxxxxxxxx@/vpninfo');

my $db = $mysql->db;

my %hash = (
    '001'=>'内部员工',
    '002'=>'经销商',
    '003'=>'服务商',
    '004'=>'供应商'
);

foreach my $key (keys %hash) {
    print "$key,$hash{$key}\n";
    $db->query('insert into userrole (id,name) values (?,?)',$key,$hash{$key});
}
